import Vue from 'vue'
import App from './App'
import store from './store'
import router from './router'
import './plugins'
import '@/layouts/export'
import UmyUi from 'umy-ui'
import 'umy-ui/lib/theme-chalk/index.css';// 引入样式
import '@/styles/main.scss';// 公共样式
import ElementUI from 'element-ui';
import "babel-polyfill";
import Print from 'vue-print-nb'
import QRCode from "qrcode"
import * as echarts from 'echarts';

import scroll from 'vue-seamless-scroll'
Vue.use(scroll)
Vue.prototype.$echarts = echarts;
// 重定义message提示，解决多次提示问题
import { message } from '@/utils/resetMessage';
Vue.prototype.$message = message;
// Global instruction



// 助手函数
import $util from '@/utils/index.js'
Vue.prototype.$util = $util

const on = Vue.prototype.$on
Vue.prototype.$on = function (event, func) {
  let timer
  let flag = true
  let newFunc = func
  if (event === 'click' || event === 'keyup') {
    newFunc = function () {
      if (flag) {
        func.apply(this, arguments)
        flag = false
      }
      clearTimeout(timer)
      timer = setTimeout(function () {
        flag = true
      }, 1000)
    }
  }
  on.call(this, event, newFunc)
}

ElementUI.Dialog.props.lockScroll.default = false;
Vue.use(Print);
Vue.use(UmyUi);
Vue.use(QRCode)
Vue.use(ElementUI);
Vue.config.productionTip = false
new Vue({
  el: '#vue-admin-beautiful',
  router,
  store,
  render: (h) => h(App),
})
